package htmlbrowser;

import javax.swing.text.Document;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;

public class HTMLBrowserEditorKit extends HTMLEditorKit {
	private HTMLBrowserParserDelegator parserDelegator;
	
	public HTMLBrowserEditorKit() {
		parserDelegator = new HTMLBrowserParserDelegator();
	}
	
	/*
	 * Returns HTMLBrowserParserDelegator used for parsing HTML
	 */
	public HTMLEditorKit.Parser getParser() {
		return parserDelegator;
	}
	
	public Document createDefaultDocument() {
		HTMLDocument doc = new HTMLBrowserDocument(getStyleSheet());
		doc.setAsynchronousLoadPriority(4);
		doc.setTokenThreshold(100);
		return doc;
	}
	
	static final long serialVersionUID = 0x0001;
}
